<template>
  <div>
    <form >
      <label>姓名：</label>
      <input v-model="name" type="text"><br><br>

      <label>年龄：</label>
      <input v-model="age" type="number"><br><br>

      <label>身高：</label>
      <input v-model="height" type="number">(米)<br><br>

      <label>体重：</label>
      <input v-model="weight"  type="number">(公斤)<br><br>

      <label>病史：</label>
      <input type="text"><br><br>

      <button @click.prevent="diaGnosis">诊断</button>
    </form>

    <p>患者{{name}}  的诊断结果：{{results}}</p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      name:'',
      age: '',
      height: '',
      weight: '',
      ache: '',
      results: '',
    }
  },
  methods: {
    diaGnosis(){
        let results1 =(this.weight / this.height)
        if(results1 >= 18.5 && results1 <= 23.9){
          this.results ='正常体质'
        }else if(results1 < 18.5){
          this.results ='太瘦了'
        }else if(results1 > 23.9){
          this.results ='太胖了'
        }
    }
  }
}











</script>